﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class CitySelectCommandHandler : IRequestHandler<CitySelectCommand, List<CityInfo>>
    {
        private readonly ICityService cityService;

        public CitySelectCommandHandler(ICityService cityService)
        {
            this.cityService = cityService;
        }

        public async Task<List<CityInfo>> Handle(CitySelectCommand request, CancellationToken cancellationToken)
        {
            return await cityService.GetCity(request.id);
        }
    }
}
